<style>
    .myOrderDetails .layui-form-label { width: 90px; padding: 8px 5px; height: 38px; line-height: 20px; border-width: 1px; border-style: solid; border-radius: 2px 0 0 2px; text-align: center; background-color: #FBFBFB; overflow: hidden; box-sizing: border-box; }
    /* .myOrderDetails .layui-form-mid { float: left; display: block; padding: 8px 5px 8px 5px !important; line-height: 20px; margin-right: 10px; color: #999 !important; position: relative; border-width: 1px; border-style: solid; border-color: #e6e6e6; }*/
    .coreshop-form { overflow-y: auto; height: 100%; box-sizing: border-box; }
    .myOrderDetails .layui-input-inline { padding-left: 5px; }
</style>

<script type="text/html" template lay-done="layui.data.sendParams(d);">

    <div class="layui-form coreshop-form  layui-form-pane myOrderDetails">
        <div class="layui-tab layui-tab-card" lay-filter="LAY-app-CoreCmsOrder-DetailsForm" id="LAY-app-CoreCmsOrder-DetailsForm">
            <ul class="layui-tab-title">
                <li class="layui-this">基本信息</li>
                <li>商品信息</li>
                <li>操作记录</li>
                <li>订单备注</li>
                <li>快递轨迹</li>
            </ul>
            <div class="layui-tab-content">
                <!--订单信息-->
                <div class="layui-tab-item layui-show">
                    <!--订单信息-->
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                        <legend style="font-size:14px;">订单信息</legend>
                    </fieldset>
                    <div class="layui-form-item" lay-size="sm">
                        <label class="layui-form-label">订单号</label>
                        <div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.orderId}}</div>

                        <label class="layui-form-label">订单金额</label>
                        <div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.orderAmount}}</div>

                        <label class="layui-form-label">下单时间</label>
                        <div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.createTime}}</div>

                        <label class="layui-form-label">支付方式</label>
                        <div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.paymentCode}}</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">订单状态</label>
                        <div class="layui-input-inline layui-inline-3 layui-form-mid">{{-d.params.data.statusText}}</div>

                        <label class="layui-form-label">快递公司</label>
                        <div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.expressName}}</div>

                        <label class="layui-form-label">快递单号</label>

                        <div class="layui-input-inline layui-inline-3 layui-form-mid">
                            {{d.params.data.expressNumber}}
                        </div>

                        <label class="layui-form-label">订单类型</label>
                        <div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.orderTypeName}}</div>
                    </div>

                    <!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend style="font-size:14px;">付款信息</legend>
        </fieldset>-->
                    <!--<div class="layui-form-item">

            <label class="layui-form-label">商品总价</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">￥{{d.params.data.goodsAmount}}</div>

            <label class="layui-form-label">配送费用</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">￥{{d.params.data.costFreight}}元</div>

            <label class="layui-form-label">应付金额</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">￥{{d.params.data.goodsAmount + d.params.data.costFreight}}元</div>

            <label class="layui-form-label">支付状态</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.payStatusText}}</div>

        </div>-->
                    <!--<div class="layui-form-item">
            <label class="layui-form-label">订单优惠金额</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">￥{{d.params.data.orderDiscountAmount}}</div>

            <label class="layui-form-label">商品优惠金额</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">￥{{d.params.data.goodsDiscountAmount}}</div>

            <label class="layui-form-label">优惠券优惠</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">￥{{d.params.data.couponDiscountAmount}}</div>

            <label class="layui-form-label">积分优惠</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">￥{{d.params.data.pointMoney}}</div>

        </div>-->
                    <!--<div class="layui-form-item">


            <label class="layui-form-label">优惠后金额</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">￥{{d.params.data.orderAmount}}元</div>

            <label class="layui-form-label">已支付金额</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">￥{{d.params.data.payedAmount}}元</div>
        </div>-->
                    <!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend style="font-size:14px;">发票信息</legend>
        </fieldset>-->
                    <!--<div class="layui-form-item">
            <label class="layui-form-label">发票类型</label>
            <div class="layui-input-inline  layui-inline-3 layui-form-mid">{{d.params.data.taxTypeText}}</div>
            <label class="layui-form-label">发票内容</label>
            <div class="layui-input-inline  layui-inline-3 layui-form-mid">
                {{# if (d.params.data.invoice.type != 1) { }}商品明细{{# } else{  }}  无 {{# }  }}
            </div>
            <label class="layui-form-label">税号</label>
            <div class="layui-input-inline  layui-inline-3 layui-form-mid">{{d.params.data.invoice.taxNumber||'无'}}</div>

            <label class="layui-form-label">发票抬头</label>
            <div class="layui-input-inline  layui-inline-3 layui-form-mid">{{d.params.data.invoice.title||'无'}}</div>
        </div>-->
                    <!--收货人信息-->
                    <!--{{# if (d.params.data.store) { }}-->
                    <!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend style="font-size:14px;">提货信息</legend>
        </fieldset>
        <div class="layui-form-item">
            <label class="layui-form-label">店铺联系电话</label>
            <div class="layui-input-inline  layui-inline-3 layui-form-mid">{{d.params.data.store.mobile}}</div>
            <label class="layui-form-label">店铺地址</label>
            <div class="layui-input-inline layui-form-mid layui-inline-10">{{d.params.data.store.allAddress}}</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">自提店铺名</label>
            <div class="layui-input-inline  layui-inline-3 layui-form-mid">{{d.params.data.store.storeName}}</div>
            <label class="layui-form-label">店铺联系人</label>
            <div class="layui-input-inline layui-form-mid">{{d.params.data.store.linkMan}}</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">提货人名</label>
            <div class="layui-input-inline  layui-inline-3 layui-form-mid">{{d.params.data.shipName}}</div>

            <label class="layui-form-label">提货人电话</label>
            <div class="layui-input-inline layui-form-mid">{{d.params.data.shipMobile}}</div>
        </div>-->
                    <!--{{# }else {}}-->
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                        <legend style="font-size:14px;">收货人信息</legend>
                    </fieldset>
                    <div class="layui-form-item">
                        <label class="layui-form-label">收货人姓名</label>
                        <div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.shipName}}</div>

                        <label class="layui-form-label">收货人电话</label>
                        <div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.shipMobile}}</div>



                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">收货地址</label>
                        <div class="layui-input-inline layui-form-mid layui-inline-14">{{d.params.data.shipAddress}}</div>
                    </div>
                    <!--{{# } }}-->
                    <!--买家备注-->
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                        <legend style="font-size:14px;">订单备注</legend>
                    </fieldset>
                    <div class="layui-form-item">
                        <label class="layui-form-label">订单备注</label>
                        <div class="layui-input-inline layui-form-mid layui-inline-10">{{d.params.data.mark||'无'}}</div>
                    </div>
                    <!--下单用户-->
                    <!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend style="font-size:14px;">下单用户</legend>
        </fieldset>-->
                    <!--<div class="layui-form-item">
            <label class="layui-form-label">用户编号</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">
                {{d.params.data.user.id}}
            </div>
            <label class="layui-form-label">用户手机</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">
                {{d.params.data.user.mobile}}
            </div><label class="layui-form-label">用户昵称</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">
                {{d.params.data.user.nickName}}
            </div><label class="layui-form-label">微信编号</label>
            <div class="layui-input-inline layui-inline-3 layui-form-mid">
                {{d.params.data.user.userWx}}
            </div>
        </div>-->
                </div>

                <!--商品详情-->
                <div class="layui-tab-item">
                    <table class="layui-table" lay-size="sm">
                        <thead>
                            <tr>
                                <th>商品名称</th>
                                <th width="30">商品<br />单价</th>
                                <th width="30">购买<br />数量</th>
                                <th width="40">商品<br />总价</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{# layui.each(d.params.data.items, function(index, item){ }}
                            <tr>
                                <td>{{item.name}}</td>
                                <td>{{item.price}}</td>
                                <td>{{item.nums}}</td>
                                <td>{{item.amount}}</td>
                            </tr>
                            {{# }); }}
                        </tbody>
                    </table>
                </div>



                <!--订单记录-->
                <div class="layui-tab-item">
                    <table class="layui-table" lay-size="sm">
                        <thead>
                            <tr>
                                <th>订单号</th>
                                <th>操作人</th>
                                <th>描述</th>
                                <th>时间</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{# layui.each(d.params.data.orderLog, function(index, item){ }}
                            <tr>
                                <td>{{item.orderId}}</td>
                                <td>{{item.userName}}</td>
                                <td>{{item.msg}}</td>
                                <td>{{item.createTime}}</td>
                            </tr>
                            {{# }); }}
                        </tbody>
                    </table>
                </div>

                <!--订单备注-->
                <div class="layui-tab-item">
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                        <legend style="font-size:14px;">备注内容</legend>
                    </fieldset>
                    <input type="hidden" name="id" value="{{d.params.data.orderId}}">
                    <textarea name="data" class="layui-input" lay-verType="tips" lay-verify="required" style="padding:10px;height:190px;">{{d.params.data.mark || ''}}</textarea>
                    <button class="layui-btn layui-btn-fluid mark-save" style="width:200px;margin:20px auto 0;display:block;" lay-submit lay-filter="LAY-app-order-saveMark-submit" id="LAY-app-order-saveMark-submit">保存备注</button>
                </div>
                <div class="layui-tab-item">
                    <table class="layui-table" lay-size="sm">
                        <thead>
                            <tr>
                                <th>快递轨迹</th>
                                <th>时间</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{# layui.each(d.params.data.kdlist, function(index, item){ }}
                            <tr>
                                <td>{{item.context}}</td>
                                <td>{{item.time}}</td>
                            </tr>
                            {{# }); }}
                        </tbody>
                    </table>

                </div>
                </div>
            </div>
    </div>
</script>

<script>
    var debug = layui.setter.debug;
    layui.data.sendParams = function (d) {
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d.params.data); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
            function () {
                var $ = layui.$
                    , form = layui.form
                    , admin = layui.admin
                    , laydate = layui.laydate
                    , upload = layui.upload
                    , cropperImg = layui.cropperImg
                    , coreHelper = layui.coreHelper;
                //重载form
                form.render(null, 'LAY-app-CoreCmsOrder-DetailsForm');
            })


    };
</script>